<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- 三个属性有一个改变都重新渲染 -->
        <div v-memo="[name,age,gender]">
            name：{{name}}，age：{{age}}，gender：{{gender}}，rmark:{{rmark}}
        </div>
        <div>
            <button @click="updateName">修改name</button>
            <button @click="updateRMark">修改rmark</button>
            <button @click="updateInfo">修改所有</button>
        </div>
    </div>
    <!-- <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> -->
    <script src="../assets/vue3.js"></script>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    name: '张三',
                    age: 23,
                    gender: '男',
                    rmark: '暂无'
                }
            },
            methods: {
                updateName() {
                    this.name = '李四';
                },
                updateRMark() {
                    // 修改不在v-memo列表中的内容，页面不会出现渲染
                    this.rmark = '修改';
                },
                updateInfo() {
                    this.name = '测试';
                    this.age = 44;
                    this.gender = '中';
                    this.rmark = '没有';
                }
            },
        });
        app.mount('#app');
    </script>
</body>

</html>